<template>
  <!-- 单商品banner -->
  <view class="goods-detail">
    <view class="shop-info">
      <text
        class="iconfont icon-store"
        style="font-size: 40rpx; font-weight: 400"
      ></text>
      <view>{{ orderitem.shop_name }}</view>
    </view>
    <view
      v-for="(goodsItem, goodsIndex) in orderitem.goods_list"
      :key="goodsIndex"
      class="list-good-item"
      @click="$utils.toUrl('/goods/goods/goods?id=' + goodsItem.goods_id)"
    >
      <view class="good-item-body">
        <image :src="goodsItem.goods_pic" mode="aspectFill"></image>
        <view class="goods-info">
          <view class="goods-name text-more-1">{{ goodsItem.name }}</view>
          <view class="goods-sku">
            <view class="flex-x-sb">
              <view
                class="sku-box text-more-2"
                v-if="orderitem.order_type == 0"
              >
                <text
                  class="sku-item"
                  v-for="(attr, attr_index) in goodsItem.attr"
                  :key="attr_index"
                >
                  {{ attr.attr_group_name }}：{{ attr.attr_name }}
                  <text
                    v-if="goodsItem.attr.length - 1 > attr_index"
                    class="sku-line"
                    >|</text
                  >
                </text>
              </view>
              <view v-else class="sku-box text-more-2"></view>
              <view>X{{ goodsItem.num }}</view>
            </view>
          </view>
          <view class="goods-price">￥{{ goodsItem.total_price }}</view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {};
  },
  props: {
    orderitem: {
      type: Object,
      default: () => {
        return {};
      },
    }
  },
  filters: {},
  methods: {
  },
};
</script>

<style lang="scss" scoped>
.goods-detail {
  width: 100%;
  background: #ffffff;
  padding-top: 36rpx;
  padding-bottom: 12rpx;

  .shop-info {
    display: flex;
    align-items: center;
    padding: 0 36rpx;
    font-weight: 600;

    > view {
      height: 40rpx;
      font-size: 28rpx;
    }
  }

  .list-good-item {
    border-bottom: 1rpx solid #f2f2f2;
    padding: 24rpx 36rpx 24rpx 36rpx;
    .good-item-body {
      display: flex;
      align-items: flex-start;
      justify-content: flex-start;

      image {
        width: 166rpx;
        height: 166rpx;
        border-radius: 10rpx;
        margin-right: 20rpx;
      }

      .goods-info {
        flex: 1;
        max-width: 480rpx;

        .goods-name {
          font-size: 28rpx;
          color: #262626;
          line-height: 40rpx;
        }

        .goods-sku {
          font-size: 24rpx;
          color: #8c8c8c;
          line-height: 34rpx;
          margin: 10rpx 0 14rpx;
          .sku-box {
            width: 326rpx;
            .sku-line {
              margin: 0 10rpx;
            }
          }
        }

        .goods-price {
          height: 44rpx;
          font-size: 32rpx;
          font-weight: 600;
        }
      }
    }

    .goods-express {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 26rpx;
      font-family: PingFang SC;
      font-weight: 400;
      color: #262626;
      margin-top: 30rpx;

      .express-info {
        display: flex;
        align-items: center;

        view {
          width: 50rpx;
          height: 26rpx;
          background: #ffffff;
          border: 1rpx solid #f27e6e;
          border-radius: 6rpx;
          display: flex;
          justify-content: center;
          align-items: center;
          font-size: 18rpx;
          font-family: PingFang SC;
          color: #f2290e;
        }

        text {
          color: #8c8c8c;
          margin-left: 16rpx;
        }
      }
    }

    .goods-btns {
      width: 100%;
      margin-top: 30rpx;
      display: flex;
      justify-content: flex-end;
      align-items: center;

      view {
        width: 152rpx;
        height: 60rpx;
        background: #ffffff;
        border: 1rpx solid #acacac;
        border-radius: 30rpx;
        font-size: 24rpx;
        font-family: PingFang SC;
        font-weight: 400;
        color: #262626;
        text-align: center;
        line-height: 60rpx;
        margin-left: 24rpx;
      }
    }
  }

  .list-good-item:last-child {
    border-bottom: 0 none;
  }

  .page-footer {
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 30rpx 0 4rpx 0;
    // border-top: 1rpx solid #f2f2f2;

    .group-item {
      display: flex;
      justify-content: center;
      align-items: center;
      flex: 1;

      image {
        width: 28rpx;
        height: 28rpx;
        display: block;
        margin-right: 14rpx;
      }

      text {
        font-size: 26rpx;
        color: #262626;
        line-height: 44rpx;
      }
    }

    .group-item:last-child {
      border-left: 2rpx solid #f2f2f2;
    }
  }
}
</style>
